package com.spsy.system.service.impl;

import java.util.List;
import com.spsy.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spsy.system.mapper.CategoryInfoMapper;
import com.spsy.system.domain.CategoryInfo;
import com.spsy.system.service.ICategoryInfoService;

/**
 * 品类信息Service业务层处理
 * 
 * @author arhat
 * @date 2024-11-14
 */
@Service
public class CategoryInfoServiceImpl implements ICategoryInfoService 
{
    @Autowired
    private CategoryInfoMapper categoryInfoMapper;

    /**
     * 查询品类信息
     * 
     * @param id 品类信息主键
     * @return 品类信息
     */
    @Override
    public CategoryInfo selectCategoryInfoById(Long id)
    {
        return categoryInfoMapper.selectCategoryInfoById(id);
    }

    /**
     * 查询品类信息列表
     * 
     * @param categoryInfo 品类信息
     * @return 品类信息
     */
    @Override
    public List<CategoryInfo> selectCategoryInfoList(CategoryInfo categoryInfo)
    {
        return categoryInfoMapper.selectCategoryInfoList(categoryInfo);
    }

    /**
     * 新增品类信息
     * 
     * @param categoryInfo 品类信息
     * @return 结果
     */
    @Override
    public int insertCategoryInfo(CategoryInfo categoryInfo)
    {
        categoryInfo.setCreateTime(DateUtils.getNowDate());
        return categoryInfoMapper.insertCategoryInfo(categoryInfo);
    }

    /**
     * 修改品类信息
     * 
     * @param categoryInfo 品类信息
     * @return 结果
     */
    @Override
    public int updateCategoryInfo(CategoryInfo categoryInfo)
    {
        categoryInfo.setUpdateTime(DateUtils.getNowDate());
        return categoryInfoMapper.updateCategoryInfo(categoryInfo);
    }

    /**
     * 批量删除品类信息
     * 
     * @param ids 需要删除的品类信息主键
     * @return 结果
     */
    @Override
    public int deleteCategoryInfoByIds(Long[] ids)
    {
        return categoryInfoMapper.deleteCategoryInfoByIds(ids);
    }

    /**
     * 删除品类信息信息
     * 
     * @param id 品类信息主键
     * @return 结果
     */
    @Override
    public int deleteCategoryInfoById(Long id)
    {
        return categoryInfoMapper.deleteCategoryInfoById(id);
    }
}
